package com.cskaoyan.service;

import com.cskaoyan.annotation.CountTime;
import com.cskaoyan.annotation.CountTimeTarget;
import org.springframework.stereotype.Service;

/**
 * @author stone
 * @date 2022/12/21 09:49
 */
@CountTimeTarget
@Service
public class UserServiceImpl implements UserService{

    @Override
    public void sayHello() {
        System.out.println("hello world");
    }

    @CountTime
    @Override
    public void sayHello(String name) {
        System.out.println("hello " + name);
    }

    @CountTime
    @Override
    public void sayGoodBye(String name) {

        System.out.println("bye " + name);
    }

    @Override
    public String sayGoodBye(String from, String dest) {
        String result = from + "对" + dest + "说再见";
        System.out.println(result);
        return result;
    }

    @Override
    public void executeError() {
        System.out.println("制造异常");
        int i = 1 / 0;
    }
}
